﻿<%@ Page Title="Template List" Language="C#" ValidateRequest="false" Theme="WebAdmin" EnableEventValidation="false"
    MasterPageFile="~/WebAdmin/WebAdmin.master" AutoEventWireup="true" CodeFile="ManageMasterPages.aspx.cs"
    Inherits="WebAdmin_ManageMasterPages" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="submenu">
        <div align="right" class="smallgraytext" style="padding: 9px;">
            <a href="AddTemplate.aspx">Create New Template</a>
        </div>
    </div>
    <div id="contenttext">
        <div style="padding: 0px 10px 10px 10px">
        
            <div style="text-align: left;">
                <h3 style="margin:0px;">
                    Template List</h3>
                <asp:Repeater ID="RPTFrames"  runat="server" 
                    onitemdatabound="RPTFrames_ItemDataBound">
                    <ItemTemplate>
                        <div onclick="OpenEditModuleDialog(<%#Eval("Id") %>,'<%#Eval("Name")%>');"
                            style="text-align: center; float: left; padding: 5px; width:130px;">
                            <a href='#'>
                                <img  id="imgTemplate" runat="server" style="border:solid 1px silver;" src="../App_Themes/WebAdmin/1322469610_style.png"  />
                            </a>
                            <div>
                                <%#Eval("Name")%></div>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
                <%-- </ul>
        </div>--%>
            </div>
        </div>
    </div>
    <br style="clear: both;" />
    <script language="javascript" type="text/javascript">
        function OpenEditModuleDialog(id, Name) {
            document.getElementById("hidMasterPageId").value = id;
            document.getElementById("txtMasterPageName").value = Name;
            $("#dialogEditContent .ModifyLink").attr("href", "../TemplateEdit.aspx?Id=" + id + "");
            $("#dialogEditContent").dialog({
                modal: true,
                title: 'Edit Template',
                width: 380,
                height: 180,
                buttons: {
                    "Save Template": function () {
                        document.getElementById("hidCommand").value = "Save";
                        document.getElementById("EditTemplate").submit();
                    },
                    "Delete Template": function () {
                        document.getElementById("hidCommand").value = "Delete";
                        document.getElementById("EditTemplate").submit();
                    },
                    Close: function () {
                        $(this).dialog('close');
                    }
                }
            });
        }
    </script>
</asp:Content>
